home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / io / ObjectOutput.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  2.5 KB  |  80 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)ObjectOutput.java    1.10 98/09/21
  3.  *
  4.  * Copyright 1996-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17. /**
  18.  * ObjectOutput extends the DataOutput interface to include writing of objects.
  19.  * DataOutput includes methods for output of primitive types, ObjectOutput
  20.  * extends that interface to include objects, arrays, and Strings.
  21.  *
  22.  * @author  unascribed
  23.  * @version 1.10, 09/21/98
  24.  * @see java.io.InputStream
  25.  * @see java.io.ObjectOutputStream
  26.  * @see java.io.ObjectInputStream
  27.  * @since   JDK1.1
  28.  */
  29. public interface ObjectOutput extends DataOutput {
  30.     /**
  31.      * Write an object to the underlying storage or stream.  The
  32.      * class that implements this interface defines how the object is
  33.      * written.
  34.      *
  35.      * @exception IOException Any of the usual Input/Output related exceptions.
  36.      */
  37.     public void writeObject(Object obj)
  38.       throws IOException;
  39.  
  40.     /**
  41.      * Writes a byte. This method will block until the byte is actually
  42.      * written.
  43.      * @param b    the byte
  44.      * @exception IOException If an I/O error has occurred.
  45.      */
  46.     public void write(int b) throws IOException;
  47.  
  48.     /**
  49.      * Writes an array of bytes. This method will block until the bytes
  50.      * are actually written.
  51.      * @param b    the data to be written
  52.      * @exception IOException If an I/O error has occurred.
  53.      */
  54.     public void write(byte b[]) throws IOException;
  55.  
  56.     /**
  57.      * Writes a sub array of bytes.
  58.      * @param b    the data to be written
  59.      * @param off    the start offset in the data
  60.      * @param len    the number of bytes that are written
  61.      * @exception IOException If an I/O error has occurred.
  62.      */
  63.     public void write(byte b[], int off, int len) throws IOException;
  64.  
  65.     /**
  66.      * Flushes the stream. This will write any buffered
  67.      * output bytes.
  68.      * @exception IOException If an I/O error has occurred.
  69.      */
  70.     public void flush() throws IOException;
  71.  
  72.     /**
  73.      * Closes the stream. This method must be called
  74.      * to release any resources associated with the
  75.      * stream.
  76.      * @exception IOException If an I/O error has occurred.
  77.      */
  78.     public void close() throws IOException;
  79. }
  80.